home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / FWPrmise.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  4.4 KB  |  152 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWPrmise.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWPRMISE_H
  11. #define FWPRMISE_H
  12.  
  13. #ifndef FWPRTDEF_H
  14. #include "FWPrtDef.h"
  15. #endif
  16.  
  17. // ----- Foundation Includes -----
  18.  
  19. #ifndef FWRUNTYP_H
  20. #include "FWRunTyp.h"
  21. #endif
  22.  
  23. #ifndef FWPRIDEB_H
  24. #include "FWPriDeb.h"
  25. #endif
  26.  
  27. // ----- OpenDoc Includes -----
  28.  
  29. #ifndef FWODTYPS_H
  30. #include "FWODTyps.h"
  31. #endif
  32.  
  33. //========================================================================================
  34. //    Forward Declarations
  35. //========================================================================================
  36.  
  37. class ODStorageUnitView;
  38. class ODStorageUnit;
  39.  
  40. class FW_CFrame;
  41. class FW_CPart;
  42. class FW_CSelection;
  43. class FW_CCloneInfo;
  44. class FW_CLinkSource;
  45. class FW_CDataInterchange;
  46.  
  47. //========================================================================================
  48. //    class FW_CPromise
  49. //========================================================================================
  50.  
  51. class FW_CPromise
  52. {
  53. //----------------------------------------------------------------------------------------
  54. //    Constructor/Destructor
  55. //
  56. public:
  57.     FW_CPromise(Environment*ev, 
  58.                 FW_StorageKinds storageKind, 
  59.                 FW_CCloneInfo* cloneInfo,
  60.                 FW_CLinkSource* linkSrc = NULL);
  61.         
  62.     
  63.     virtual ~FW_CPromise();
  64.  
  65. //----------------------------------------------------------------------------------------
  66. //    New API
  67. //
  68. public:
  69.     virtual void        Promise(Environment *ev, 
  70.                                 ODStorageUnit* storageUnit, 
  71.                                 ODPropertyName propertyName, 
  72.                                 ODValueType valueType);
  73.     
  74.     virtual void         FulfillPromise(Environment *ev,
  75.                                 FW_CPart* part, 
  76.                                 ODStorageUnitView *promiseSUView, 
  77.                                 ODPropertyName propertyName,
  78.                                 ODValueType valueType, 
  79.                                 FW_CCloneInfo* cloneInfo) = 0;
  80.  
  81.     FW_CFrame*            GetScopeFrame(Environment *ev) const;    
  82.     
  83.     FW_StorageKinds        GetStorageKind(Environment *ev) const;    
  84.     
  85.     ODUpdateID            GetUpdateID(Environment *ev) const;
  86.     
  87.     long                GetCount(Environment *ev) const;
  88.  
  89. //----------------------------------------------------------------------------------------
  90. //    Internal only
  91. //
  92. public:
  93.     long                PrivHandleFulfillPromise(Environment *ev, 
  94.                                 FW_CPart* part,
  95.                                 ODStorageUnitView *promiseSUView);
  96.     FW_CLinkSource*        PrivGetLinkSource(Environment *ev) const;
  97.  
  98. //----------------------------------------------------------------------------------------
  99. //    Data members
  100. //
  101. private:
  102.     FW_CFrame*                fScopeFrame;
  103.     FW_StorageKinds            fStorageKind;
  104.     ODUpdateID                fUpdateID;            // for clipboard promise
  105.     FW_CLinkSource*            fLinkSource;        // for link promise
  106.     FW_Boolean                fPromised;
  107.     FW_CDataInterchange*    fDataInterchange;
  108.     long                    fPromiseCount;
  109. };
  110.  
  111. //----------------------------------------------------------------------------------------
  112. //    FW_CPromise::GetUpdateID
  113. //----------------------------------------------------------------------------------------
  114. inline ODUpdateID FW_CPromise::GetUpdateID(Environment*) const
  115. {
  116.     return fUpdateID;
  117. }
  118.  
  119. //----------------------------------------------------------------------------------------
  120. //    FW_CPromise::GetScopeFrame
  121. //----------------------------------------------------------------------------------------
  122. inline FW_CFrame* FW_CPromise::GetScopeFrame(Environment*) const
  123. {
  124.     return fScopeFrame;
  125. }
  126.  
  127. //----------------------------------------------------------------------------------------
  128. //    FW_CPromise::GetStorageKind
  129. //----------------------------------------------------------------------------------------
  130. inline FW_StorageKinds FW_CPromise::GetStorageKind(Environment*) const
  131. {
  132.     return fStorageKind;
  133. }
  134.  
  135. //----------------------------------------------------------------------------------------
  136. //    FW_CPromise::PrivGetLinkSource
  137. //----------------------------------------------------------------------------------------
  138. inline FW_CLinkSource* FW_CPromise::PrivGetLinkSource(Environment*) const
  139. {
  140.     FW_ASSERT(fStorageKind == FW_kLinkStorage);
  141.     return fLinkSource;
  142. }
  143.  
  144. //----------------------------------------------------------------------------------------
  145. //    FW_CPromise::GetCount
  146. //----------------------------------------------------------------------------------------
  147. inline long FW_CPromise::GetCount(Environment*) const
  148. {
  149.     return fPromiseCount;
  150. }
  151.  
  152. #endif